package com.xuzhiguang.baidu.pan.sdk.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;

import java.util.List;

/**
 * @author xuzhiguang
 * @date 2020/6/26 22:59
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)
@JsonIgnoreProperties(ignoreUnknown = true)
public class BasicFileMoveParams {

    /**
     * 0 同步、1 自适应、2 异步
     */
    private Integer async;

    private List<File> filelist;

    @Override
    public String toString() {
        return "BasicFileMoveParams{" +
                "async=" + async +
                ", filelist=" + filelist +
                '}';
    }

    public Integer getAsync() {
        return async;
    }

    public void setAsync(Integer async) {
        this.async = async;
    }

    public List<File> getFilelist() {
        return filelist;
    }

    public void setFilelist(List<File> filelist) {
        this.filelist = filelist;
    }

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class File {

        /**
         * 文件绝对路径
         */
        private String path;

        /**
         * move到哪个文件夹
         */
        private String dest;

        /**
         * move后的新文件名
         */
        private String newname;

        /**
         * 	遇到重复文件的处理策略,
         * fail(默认，直接返回失败)、newcopy(重命名文件)、overwrite、skip
         */
        private String ondup;

        @Override
        public String toString() {
            return "File{" +
                    "path='" + path + '\'' +
                    ", dest='" + dest + '\'' +
                    ", newname='" + newname + '\'' +
                    ", ondup='" + ondup + '\'' +
                    '}';
        }

        public String getPath() {
            return path;
        }

        public void setPath(String path) {
            this.path = path;
        }

        public String getDest() {
            return dest;
        }

        public void setDest(String dest) {
            this.dest = dest;
        }

        public String getNewname() {
            return newname;
        }

        public void setNewname(String newname) {
            this.newname = newname;
        }

        public String getOndup() {
            return ondup;
        }

        public void setOndup(String ondup) {
            this.ondup = ondup;
        }
    }
}
